package com.wanbangee.marksystem.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.wanbangee.marksystem.entities.StatisticsAverageRanking;

@Mapper
public interface StatisticsAverageRankingDao {
	/**查询统计各班级名称/人数/评分均/班主任/最高分/最低分
	 * @param examId
	 * @param subId
	 * @return
	 */
	public List<StatisticsAverageRanking> selectStatisticsAverageRankingByExamIdAndSubId(@Param("examId")Integer examId,@Param("subId") Integer subId);
	
	
	
	/**查询统计各班级名称/人数/评分均/班主任/最高分/最低分   改
	 * @param examId
	 * @param subId
	 * @return
	 */
	public List<Map> selectStatisticsAverageRanking(@Param("examId")Integer examId,@Param("subId") Integer subId);
	
	/**班级成绩分析功能:
	 * 本次考试中此班级的全部科目的信息
	 * 当前班级当前考试所有科目的平均分，排名，较上次排名变化，优秀率，优秀人数，良好率，良好人数，及格率，及格人数，最高分最，低分，任课老师名称，学科名称
	 * @param claId
	 * @param examId
	 * @return
	 */
	public List<StatisticsAverageRanking> selectClassSubInfo(@Param("claId")Integer claId,@Param("examId")Integer examId);
	
	/**
	 * 根据考试Id,班级Id,科目Id查询该班级此次考试科目的一分三率
	 * @param exam_id
	 * @param claId
	 * @param subId
	 * @return
	 */
	public Map<String, Object> selectOnePointAndThree(@Param("examId")Integer examId,@Param("claId") Integer claId,@Param("subId") Integer subId);
	
	/**
	 * 根据考试Id,学科Id,班级Id查询本次考试班级平均分，年级平均分，平均分年级排名
	 * @param examId
	 * @param subId
	 * @param claId
	 * @return
	 */
	public Map<String, Object> selectAverageAndRankingAndGradeAvg(@Param("examId")Integer examId,@Param("subId")Integer subId,@Param("claId")Integer claId);
	
	/**
	 * 根据考试Id,学科Id,班级Id查询班级历次考试平均分排名
	 * @param examId
	 * @param subId
	 * @param claId
	 * @return
	 */
	public List<StatisticsAverageRanking> selectExamNmAndRanking(@Param("examId")Integer examId,@Param("subId")Integer subId,@Param("claId")Integer claId);
	
	/**
	 * 根据考试Id,学科Id,班级Id查询优秀率年级排名，本次考试班级优秀率，年级优秀率
	 * @param examId
	 * @param subId
	 * @param claId
	 * @return
	 */
	public Map<String, Object> selectExcellentRateAndExceGradeRankAndGradeAvgRanking(@Param("examId")Integer examId,@Param("subId")Integer subId,@Param("claId")Integer claId);
	
	/**
	 * 根据考试Id,学科Id,班级Id查询班级历次考试优秀率排名
	 * @param examId
	 * @param subId
	 * @param claId
	 * @return
	 */
	public Map<String, Object> selectExamNmAndExcellentRateRanking(@Param("examId")Integer examId,@Param("subId")Integer subId,@Param("claId")Integer claId);
	
	/**
	 * 根据考试Id,学科Id,班级Id查询良好率年级排名，本次考试班级良好率，年级良好率
	 * @param examId
	 * @param claId
	 * @param subId
	 * @return
	 */
	public Map<String, Object> selectGoodRateAndGoodGradeRankAndGradeAvgRanking(@Param("examId")Integer examId,@Param("claId")Integer claId,@Param("subId")Integer subId);
	
	/**
	 * 根据考试Id,学科Id,班级Id查询班级历次良好率排名
	 * @param examId
	 * @param claId
	 * @param subId
	 * @return
	 */
	public Map<String, Object> selectExamNmAndGoodRateRanking(@Param("examId")Integer examId,@Param("claId")Integer claId,@Param("subId")Integer subId);
	
	/**
	 * 根据考试Id,学科Id,班级Id查询及格率年级排名，本次考试班级及格率，年级及格率
	 * @param examId
	 * @param claId
	 * @param subId
	 * @return
	 */
	public Map<String, Object> selectPassRateAndPassGradeRankAndPassAvgRanking(@Param("examId")Integer examId,@Param("claId")Integer claId,@Param("subId")Integer subId);
	
	/**
	 * 根据考试Id,学科Id,班级Id查询班级历次及格率排名
	 * @param examId
	 * @param claId
	 * @param subId
	 * @return
	 */
	public Map<String, Object> selectExamNmAndPassRateRanking(@Param("examId")Integer examId,@Param("claId")Integer claId,@Param("subId")Integer subId);
	
	/**
	 * 根据班级Id和科目Id查询考试Id
	 * @param claId
	 * @param subId
	 * @return
	 */
	public List<Integer> selectExamIdByClaIdAndSubId(@Param("examId")Integer examId,@Param("claId")Integer claId,@Param("subId")Integer subId);
	
	
	
}
